<script setup lang="ts">
import type { FormDesignerComponents } from "../FormComponentMixin";
import CommonConfig from "./CommonConfig.vue";
const config = defineModel<FormDesignerComponents>("config");
const propsCollapse = ref("0");
</script>

<template>
  <el-collapse v-model="propsCollapse" accordion>
    <el-collapse-item name="0">
      <template #title>
        <div class="collapse-title">
          <el-icon color="#1890ff"><List /></el-icon>
          <div>基本属性</div>
        </div>
      </template>
      <CommonConfig v-model:config="config" />
      <el-form-item label="分栏数">
        <el-select v-model="config.props.number">
          <el-option label="分2栏" :value="2" />
          <el-option label="分3栏" :value="3" />
          <el-option label="分4栏" :value="4" />
          <el-option label="分6栏" :value="6" />
          <el-option label="分8栏" :value="8" />
        </el-select>
      </el-form-item>
      <el-form-item label="栏间隔">
        <el-input
          v-model="config.props.gutter"
          type="number"
          placeholder="每栏间隔多少"
        />
      </el-form-item>
    </el-collapse-item>
  </el-collapse>
</template>

<style lang="scss" scoped>
.collapse-title {
  padding: 0px 5px;
  display: flex;
  align-items: center;

  & > div {
    margin-left: 10px;
  }
}
</style>
